<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			#div1{
				width: 100px;
				height: 100px;
				background: red;
			}
		</style>
		<script>
			window.onload=function(){
				var oDiv=document.getElementById("div1");
				//oDiv.style.backgroundColor="yellow";
				
				//alert(oDiv.currentStyle.width);
				var obj=getComputedStyle(oDiv,null);
				alert(obj.width);
			}
		</script>
	</head>
	<body>
		<div id="div1"></div>
	</body>
</html>
